package com.aizuda.boot.modules.business.contract.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("contract_type")
@Schema(description = "合同类型")
public class ContractTypeEntity {
    @TableId(type = IdType.AUTO)
    @Schema(description = "合同类型ID")
    private Integer id;

    @Schema(description = "父级类型ID")
    private Integer parentId;

    @TableField(exist = false)
    @Schema(description = "父级类型名称")
    private String[] parentTypeNames; // 新增字段，存储父类别名称

    @Schema(description = "类型名称")
    private String typeName;

    @Schema(description = "类型缩写")
    private String typeAbbreviation;

    @Schema(description = "类型说明")
    private String typeDescription;

    @Schema(description = "是否启用")
    private Boolean isEnabled;

    @Schema(description = "是否可新增对方")
    private Boolean allowAddCounterparty;

    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;

    @Schema(description = "可用于创建(上传)")
    private Boolean canCreateUpload;

    @Schema(description = "可用于创建(模板)")
    private Boolean canCreateTemplate;

    @Schema(description = "可用于变更(补充)")
    private Boolean canChangeSupplement;

    @Schema(description = "可用于变更(修改表单)")
    private Boolean canChangeModifyForm;

    @Schema(description = "可用于终止(终止)")
    private Boolean canTerminateTermination;

    @Schema(description = "可用于终止(到期)")
    private Boolean canTerminateExpiry;

    @Schema(description = "可用于终止(作废)")
    private Boolean canTerminateVoid;

    @Schema(description = "排序序号")
    private Integer typeOrder;

    @TableField(exist = false)
    @Schema(description = "子类别列表")
    private List<ContractTypeEntity> children; // 添加子类别列表属性

    @Schema(description = "长期合同管理")
    private Long longTermId;

    @Schema(description = "适用合同类型", examples = {"user", "department"},required = true)
    private String applicableType;
}